package com.voicechat.firstmet.net.service;

import android.util.Log;

import com.voicechat.firstmet.bean.FristMetBean;
import com.voicechat.firstmet.bean.Result;
import com.voicechat.firstmet.net.Params;

import rx.Observable;

/**
 * @ProjectName: FirstMet
 * @Package: com.voicechat.firstmet.net.service
 * @ClassName: FristMetService
 * @Description: 初见service
 * @Author: ljp
 * @CreateDate: 2018/10/22 15:50
 * @Version: 1.0
 */
public class FristMetService extends BaseService {
    private  static String TAG = "FristMetService";
    /**
     * @method
     * @description 初见请求
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<FristMetBean> fristMetList(String id,String token, String equipmentId, String page,
                                                        String longitude,String dimension, String longitudeUpper, String dimensionLower) {
        Params params = new Params();
        params.put("userId", id);
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("longitude", longitude); // 经度下限
        params.put("dimension", dimension);// 维度下限
        params.put("longitudeUpper", longitudeUpper);// 经度上限
        params.put("dimensionUpper", dimensionLower);// 维度上限
        params.put("pageNo", page);
        params.put("pageSize", "10");//一页返回多少条数据 默认10
        Log.i(TAG, "fristMetList: -----"+params);
        return sNetInterface.fristMetList(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description 喜欢（关注、不关注)
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<Result> fristMetLike(String token, String equipmentId,String userId,String anchorId) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("anchorId", anchorId);//被关注人id
        params.put("userId", userId);//自己的id
        Log.i("fristMetLike", "fristMetLike: -----"+params);
        return sNetInterface.fristMetLike(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description 喜欢（关注、不关注)
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<FristMetBean> fristMetLikeRight(String token, String equipmentId,String userId,String anchorId) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("anchorId", anchorId);//被关注人id
        params.put("userId", userId);//自己的id
        params.put("type", "1");//自己的id
        Log.i("fristMetLike", "fristMetLike: -----"+params);
        return sNetInterface.fristMetLikeRight(params).compose(applySchedulers());
    }
    /**
     * @method
     * @description 喜欢（关注、不关注)
     * @date: 2018/10/19 16:42
     * @author: ljp
     * @return
     */
    public static Observable<FristMetBean> fristMetLikeLeft(String token, String equipmentId,String userId,String anchorId) {
        Params params = new Params();
        params.put("token", token);
        params.put("equipmentId", equipmentId);
        params.put("anchorId", anchorId);//被关注人id
        params.put("userId", userId);//自己的id
        params.put("type", "1");//自己的id
        Log.i("fristMetLike", "fristMetLike: -----"+params);
        return sNetInterface.fristMetLikeLeft(params).compose(applySchedulers());
    }
}
